sound object
This method will start the sound playback.
bool play()
Parameters:
None.
Return value:
true on success, false on failure.
Remarks:
This method returns immediately after the sound has started playing, it does not wait for the playback to finish. In order to determine when the sound has stopped, use the "playing" property.
Example:
// Play a sound, and then manually wait for it to stop before exiting.
void main()
{
sound ambience;
ambience.load("ding.ogg");
if(ambience.active==false)
{
alert("Error", "The sound could not be loaded.");
exit();
}
ambience.play();
while(ambience.playing==true)
{
wait(5);
}
}